function [r, varargout] = size(lst, d)
%SIZE Gets the size of the list object in MATLAB convention
%
% [ History ] 
%   - Created by Dahua Lin, on Jan 5,2006
%

%% main

if nargin == 1          
    if nargout <= 1
        r = [lst.n, 1];        
    elseif nargout == 2
        r = lst.n;
        varargout = {1};        
    else
        r = lst.n;
        varargout = cell(1, nargout-1);
        [varargout{:}] = deal(1);
    end
    
else    
    if d == 1
        r = lst.n;
    else
        r = 1;
    end
end
